<template>
    <view>
        <template v-if="list.length > 0">
            <view class="padding-bottom-base">
                <view
                    v-for="item in list"
                    @click="goPage(`/pages/goods/goodsdetail?id=${item.itemid}`)"
                    class="margin-sm bg-white padding-sm radius-lg flex"
                    style="box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1)"
                >
                    <image class="radius-lg size-img-base margin-right-base" :src="item.thumb" mode="aspectFill" />
                    <view class="">
                        <view class="text-bold product-title">{{ item.title }}</view>
                        <view class="text-red text-bold margin-top-sm">
                            <text>￥</text>
                            <text class="text-lg">{{ item.price }}</text>
                        </view>
                    </view>
                </view>
            </view>
        </template>
        <template v-else>
            <empty emptyText="该分类暂无商品" isHasBtn btnText="去首页逛逛" btnLink="/pages/index/index" />
        </template>
    </view>
</template>

<script lang="ts" setup>
import empty from "../common/empty.vue";
import { goPage } from "@/utils";
import { useMemberStore } from "@/store/module/member";

const memberStore = useMemberStore();
const props = withDefaults(defineProps<{ list: any[] }>(), {
    list: () => []
});
</script>

<style lang="scss" scoped></style>
